<div id="main">
  <h2><%= t('h2.contacts') %></h2>
  <%= render :partial => "search" %>
  <%= will_paginate @contacts %>
  共&nbsp;<%= @contacts.total_entries %>&nbsp;条记录
  <%= per_page_select_tag('per_page' ,{} , params[:per_page]|| 50 ,{}) %>
  <br class="clear"/>
  <table class="data2 order-table">
    <tr>
      <th><%= order_by_link :id,:text=>"ID"%></th>
      <th><%= order_by_link :name, :text => Contact.human_attribute_name("name") %></th>
      <th width="15%"><%= order_by_link :tel, :text => Contact.human_attribute_name("tel") %></th>
      <th><%= order_by_link :email, :text => Contact.human_attribute_name("email") %></th>
      <th><%= order_by_link :business_type, :text =>  Contact.human_attribute_name("business_type") %></th>
      <th width="15%"><%= order_by_link :created_at, :text => Contact.human_attribute_name("created_at") %></th>
      <th width="12%"><%=  t('labels.operation') %></th>
    </tr>
    <% @contacts.each do |contact| %>
      <tr class="<%= cycle("", "even") %>">
        <td><%= contact.id %></td>
        <td><%= contact.name %></td>
        <td><%= contact.tel %></td>
        <td><%= contact.email %></td>
        <td><%= contact.business_type %></td>
        <td><%= parse_date contact.created_at %></td>
          <td>
            <%= link_to t('labels.edit'), edit_admin_contact_path(contact) %><br/>
            <%= link_to t('labels.delete'), admin_contact_path(contact), :confirm => "are your sure?", :method => :delete %><br/>
          </td>
      </tr>
    <% end %>
  </table>

  <%= will_paginate @contacts %>

</div>
